// custom-tab-bar/index.js
import { storeBindingsBehavior } from "mobx-miniprogram-bindings";
import { store } from "../store/index";
Component({
  behaviors: [storeBindingsBehavior],
  /**
   * 组件的属性列表
   */
  storeBindings: {
    store,
    fields: {
      active: 'active'
    },
    actions: {
      updateActive: 'updateActive'
    }
  },
  properties: {

  },
  /**
   * 组件的初始数据
   */
  data: {
    
  },
  /**
   * 组件的方法列表
   */
  methods: {
    onChange(e) {
      wx.switchTab({
        url: e.detail,
      })
      this.updateActive(e.detail)
    } 
  }
})
